<?xml version="1.0"?>

<xsl:stylesheet version="1.0" 
        xmlns="http://www.w3.org/1999/xhtml"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:tt="muf.sk/gradebook/timetable_class">
    
    <xsl:template match="/tt:timetable">
        <html xmlns="http://www.w3.org/1999/xhtml">
            <head>
                <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
                <meta http-equiv="Content-Language" content="sk" />
                <link href="/gradebook/css/timetable.css" type="text/css" rel="stylesheet" />
                <title>Gradebook</title>
                <meta name="author" content="Pavol Fogaš, Martin Vasko, Matúš Vojtko" />
            </head>
            <body>
                <h1>Rozvrh triedy <xsl:value-of select="tt:class" /></h1>
                <table class="timetable">
                    <tr>
                        <th>Hodina</th>
                        <th>0</th>
                        <th>1</th>
                        <th>2</th>
                        <th>3</th>
                        <th>4</th>
                        <th>5</th>
                        <th>6</th>
                        <th>7</th>
                        <th>8</th>
                        <th>9</th>
                    </tr>
                    <tr>
                        <th>Pondelok</th>
                        <xsl:apply-templates select="tt:monday" />
                    </tr>
                    <tr>
                        <th>Utorok</th>
                        <xsl:apply-templates select="tt:tuesday" />
                    </tr>
                    <tr>
                        <th>Streda</th>
                        <xsl:apply-templates select="tt:wednesday" />
                    </tr>
                    <tr>
                        <th>Štvrtok</th>
                        <xsl:apply-templates select="tt:thursday" />
                    </tr>
                    <tr>
                        <th>Piatok</th>
                        <xsl:apply-templates select="tt:friday" />
                    </tr>
                </table>
            </body>
        </html>
    </xsl:template>

    <xsl:template match="tt:monday | tt:tuesday | tt:wednesday | tt:thursday | tt:friday">
        <xsl:for-each select="tt:lesson">
            <td>
                <xsl:value-of select="tt:subject" />
                <br />
                <xsl:value-of select="tt:teacher" />
            </td>
        </xsl:for-each>
    </xsl:template>
    
</xsl:stylesheet>